package com.tools.app.receiver;

import android.content.BroadcastReceiver;
import android.content.Context;
import android.content.Intent;
import android.text.TextUtils;

import com.hm.base.android.mob.AMApplication;

/**
 * desc:
 * date: 2018/1/5
 * author: ancun
 */

public class KeyReasonReceiver extends BroadcastReceiver {

    private static final String SYSTEM_REASON = "reason";

    private static final String SYSTEM_HOME_KEY = "homekey";

    @Override
    public void onReceive(Context context, Intent intent) {
        String action = intent.getAction();
        if (action.equals(Intent.ACTION_CLOSE_SYSTEM_DIALOGS)) {
            String reason = intent.getStringExtra(SYSTEM_REASON);
            if (TextUtils.equals(reason, SYSTEM_HOME_KEY)) {
                AMApplication imContext = AMApplication.getInstance();
                //imContext.handleMobEmptyMessage(R.id.msg_app_home_key_press);

            }
        }

    }

}
